# 作者：宋安康
# 开发时间：2023/5/8 10:58
a = 3.14159
print(a, type(a))

# 浮点数计算不精确
n1 = 1.1
n2 = 2.20
print(n1 + n2)
# 改进
from decimal import Decimal
print(Decimal('1.1')+Decimal('2.2'))
print(Decimal("100.2")+Decimal("1.11"))

x = 10
y = 10.1
print(type(x))
print(type(y))

print(0.1+0.2)
print(round(0.1+0.2, 1))


# 复数
x = 123+456j
print(x.real)
print(x.imag)